﻿@using System.Data;
@model DTcms.Model.BaseModel
@{
    ViewBag.Title = Model.site.name + "-" + Model.site.seo_title;
    string templateskin = Model.templateskin;
}
@section HeaderContent{

}
<!--Banner-->
<div class="slide-box">
    <div class="layui-carousel" id="slide-box">
        <div carousel-item>
            @{
                DataTable bannerList = Html.get_plugin_method("DTcms.Web.Plugin.Images", "images", "get_images_list", "banner");
                foreach (DataRow dr in bannerList.Rows)
                {
                    <div>
                        <a title="@dr["title"]" href="@dr["link_url"]"><img src="@dr["img_url"]" width="@dr["width"]" height="@dr["height"]" alt="@dr["title"]" /></a>
                    </div>
                }
            }
        </div>
    </div>
</div>
<!--/Banner-->
<!--新闻资讯-->
<div class="section">
    <div class="main-tit">
        <h2>新闻资讯</h2>
        <p>
            @{
                var newsCList = Html.get_category_child_list("news", 0, 0);
                foreach (var dr in newsCList)
                {
                    <a href="@Html.linkurl("news_list",dr.id)">@dr.title</a>
                }
            }
            <a href="@Html.linkurl("news")">更多<i>+</i></a>
        </p>
    </div>
    <div class="wrapper clearfix">
        <div class="wrap-box">
            <div class="left-455" style="margin:0;height:341px;">
                <div class="focus-box layui-carousel" id="focus-box">
                    <div class="slides" carousel-item>
                        @{
                            DataTable focusNews = Html.get_article_list("news", 0, 8, "status=0 and is_slide=1 and img_url<>''");
                            foreach (DataRow dr in focusNews.Rows)
                            {
                                <div class="focus-div">
                                    <a title="@dr["title"]" href="@Html.linkurl("news_show",dr["id"])">
                                        <span class="note-bg"></span>
                                        <span class="note-txt">@dr["title"]</span>
                                        <img src="@dr["img_url"]" />
                                    </a>
                                </div>
                            }
                        }
                    </div>
                </div>
            </div>
            <div class="left-455">
                <ul class="side-txt-list">
                    @{
                        DataTable newsList = Html.get_article_list("news", 0, 10, "status=0");
                        foreach (DataRow newdr in newsList.Rows)
                        {
                            int newdr__loop__id = newsList.Rows.IndexOf(newdr)+1;
                            if (newdr__loop__id == 1 || newdr__loop__id == 6)
                            {
                                <li class="tit"><a href="@Html.linkurl("news_show",newdr["id"])">@newdr["title"]</a></li>
                            }
                            else
                            {
                                <li><span>@Html.datetostr(newdr["add_time"], "yyyy-MM-dd")</span><a href="@Html.linkurl("news_show",newdr["id"])">@newdr["title"]</a></li>
                            }
                        }
                    }
                </ul>
            </div>
            <div class="left-220">
                <ul class="side-img-list">
                    @{
                        DataTable topNewsList = Html.get_article_list("news", 0, 4, "status=0 and is_top=1 and img_url<>''");
                        foreach (DataRow topdr in topNewsList.Rows)
                        {
                            int topdr__loop__id = topNewsList.Rows.IndexOf(topdr)+1;
                            <li>
                                <div class="img-box">
                                    <label>@topdr__loop__id</label>
                                    <img src="@topdr["img_url"]" />
                                </div>
                                <div class="txt-box">
                                    <a href="@Html.linkurl("news_show",topdr["id"])">@topdr["title"]</a>
                                    <span>@Html.datetostr(topdr["add_time"], "yyyy-MM-dd")</span>
                                </div>
                            </li>
                        }
                    }
                </ul>
            </div>
        </div>
    </div>
</div>
<!--/新闻资讯-->
<!--/购物商城-->
<div class="section">
    <div class="main-tit">
        <h2>购物商城</h2>
        <p>
            @{
                var goodsCList = Html.get_category_child_list("goods", 0, 0);
                foreach (var dr in goodsCList)
                {
                    <a href="@Html.linkurl("goods_list",dr.id)">@dr.title</a>
                }
            }
            <a href="@Html.linkurl("goods")">更多<i>+</i></a>
        </p>
    </div>
    <div class="wrapper clearfix">
        <div class="wrap-box">
            <ul class="img-list">
                @{
                    DataTable redGoods = Html.get_article_list("goods", 0, 10, "status=0 and is_red=1");
                    foreach (DataRow dr in redGoods.Rows)
                    {
                        <li>
                            <a title="@dr["title"]" href="@Html.linkurl("goods_show",dr["id"])">
                                <div class="img-box">
                                    <img src="@dr["img_url"]" />
                                </div>
                                <div class="info">
                                    <h3>@dr["title"]</h3>
                                    <p>
                                        <strong>人气 @dr["click"]</strong>
                                        <span class="price">¥@dr["sell_price"]</span>
                                    </p>
                                </div>
                            </a>
                        </li>
                    }
                }
            </ul>
        </div>
    </div>
</div>
<!--/购物商城-->
<!--/视频专区-->
<div class="section">
    <div class="main-tit">
        <h2>视频专区</h2>
        <p>
            @{
                var videoCList = Html.get_category_child_list("video", 0, 0);
                foreach (var dr in videoCList)
                {
                    <a href="@Html.linkurl("video_list",dr.id)">@dr.title</a>
                }
            }
            <a href="@Html.linkurl("video")">更多<i>+</i></a>
        </p>
    </div>
    <div class="wrapper clearfix">
        <div class="wrap-box">
            <div class="left-455" style="margin:0;">
                <div class="side-img-box">
                    @{
                        DataTable focusVideo = Html.get_article_list("video", 0, 1, "status=0 and is_slide=1");
                        foreach (DataRow dr in focusVideo.Rows)
                        {
                            <a title="@dr["title"]" href="@Html.linkurl("video_show",dr["id"])">
                                <em><i class="iconfont icon-play"></i></em>
                                <div class="abs-bg"></div>
                                <div class="info">
                                    <h3>@dr["title"]</h3>
                                    <p>@dr["sub_title"]</p>
                                </div>
                                <img src="@dr["img_url"]" />
                            </a>
                        }
                    }
                </div>
            </div>
            <div class="left-690">
                <ul class="img-list">
                    @{
                        DataTable redVideo = Html.get_article_list("video", 0, 6, "status=0 and is_red=1");
                        foreach (DataRow dr in redVideo.Rows)
                        {
                            <li>
                                <a title="@dr["title"]" href="@Html.linkurl("video_show",dr["id"])">
                                    <div class="img-box"><img src="@dr["img_url"]" /></div>
                                    <em><i class="iconfont icon-play"></i></em>
                                    <div class="abs-bg"></div>
                                    <div class="remark">
                                        <h3>@dr["title"]</h3>
                                        <p>@dr["sub_title"]</p>
                                    </div>
                                </a>
                            </li>
                        }
                    }
                </ul>
            </div>
        </div>
    </div>
</div>
<!--/视频专区-->
<!--/图片分享-->
<div class="section">
    <div class="main-tit">
        <h2>图片分享</h2>
        <p>
            @{
                var photoCList = Html.get_category_child_list("photo", 0, 0);
                foreach (var dr in photoCList)
                {
                    <a href="@Html.linkurl("photo_list",dr.id)">@dr.title</a>
                }
            }
            <a href="@Html.linkurl("photo")">更多<i>+</i></a>
        </p>
    </div>
    <div class="wrapper clearfix">
        <div class="wrap-box">
            <div class="left-455" style="margin:0;">
                <div class="side-img-box">
                    @{
                        DataTable focusPhoto = Html.get_article_list("photo", 0, 1, "status=0 and is_slide=1");
                        foreach (DataRow dr in focusPhoto.Rows)
                        {
                            <a title="@dr["title"]" href="@Html.linkurl("photo_show",dr["id"])">
                                <div class="abs-bg"></div>
                                <div class="info">
                                    <h3>@dr["title"]</h3>
                                    <p>@Html.datetostr(dr["add_time"], "yyyy-MM-dd")</p>
                                </div>
                                <img src="@dr["img_url"]" />
                            </a>
                        }
                    }
                </div>
            </div>
            <div class="left-690">
                <ul class="img-list">
                    @{
                        DataTable redPhoto = Html.get_article_list("photo", 0, 6, "status=0 and is_red=1");
                        foreach (DataRow dr in redPhoto.Rows)
                        {
                            <li>
                                <a title="@dr["title"]" href="@Html.linkurl("photo_show",dr["id"])">
                                    <div class="img-box"><img src="@dr["img_url"]" /></div>
                                    <div class="abs-bg"></div>
                                    <div class="remark">
                                        <h3>@dr["title"]</h3>
                                        <p>@Html.datetostr(dr["add_time"], "yyyy-MM-dd")</p>
                                    </div>
                                </a>
                            </li>
                        }
                    }
                </ul>
            </div>
        </div>
    </div>
</div>
<!--/图片分享-->
<!--/资源下载-->
<div class="section">
    <div class="main-tit">
        <h2>资源下载</h2>
        <p>
            @{
                var downCList = Html.get_category_child_list("down", 0,0);
                foreach (var dr in downCList)
                {
                    <a href="@Html.linkurl("down_list",dr.id)">@dr.title</a>
                }
            }
            <a href="@Html.linkurl("down")">更多<i>+</i></a>
        </p>
    </div>
    <div class="wrapper clearfix">
        <div class="wrap-box">
            <ul class="img-list" id="artAttach">
                @{
                    DataTable redDown = Html.get_article_list("down", 0, 5, "status=0 and is_red=1");
                    foreach (DataRow dr in redDown.Rows)
                    {
                        <li>
                            <a title="@dr["title"]" href="@Html.linkurl("down_show",dr["id"])">
                                <div class="img-box"><img src="@dr["img_url"]" /></div>
                                <div class="info">
                                    <h3>@dr["title"]</h3>
                                    <p>
                                        <strong>下载<span class="b_attach tg_chrnum_@dr["id"]" data-tgid="@dr["id"]">0</span></strong>
                                        <span>@Html.datetostr(dr["add_time"], "yyyy-MM-dd")</span>
                                    </p>
                                </div>
                            </a>
                        </li>
                    }
                }
            </ul>
        </div>
    </div>
</div>
<!--/资源下载-->
<!--留言链接-->
<div class="section">
    <div class="wrapper clearfix">
        <div class="left-690 side-link-wrap" style="margin:0;">
            <div class="main-tit">
                <h2>友情链接</h2>
                <p>
                    <a href="@Html.linkurl("link")">更多<i>+</i></a>
                </p>
            </div>
            <div class="side-link clearfix">
                <ul class="img">
                    @{
                        DataTable linkImg = Html.get_plugin_method("DTcms.Web.Plugin.Link", "link", "get_link_list", 6, "site_id=" + Model.site.id + " and is_lock=0 and is_image=1 and is_red=1");
                        foreach (DataRow dr in linkImg.Rows)
                        {
                            <li>
                                <a title="@dr["title"]" href="@dr["site_url"]" target="_blank">
                                    <img src="@dr["img_url"]">
                                </a>
                            </li>
                        }
                    }
                </ul>
                <div class="txt">
                    @{
                        DataTable linkTxt = Html.get_plugin_method("DTcms.Web.Plugin.Link", "link", "get_link_list", 0, "site_id=" + Model.site.id + " and is_lock=0 and is_image=0 and is_red=1");
                        foreach (DataRow dr in linkTxt.Rows)
                        {
                            <a href="@dr["site_url"]" target="_blank">@dr["title"]</a>
                            <strong>|</strong>
                        }
                    }
                </div>
            </div>
        </div>
        <div class="left-455">
            <div class="main-tit">
                <h2>留言反馈</h2>
                <p>
                    <a href="@Html.linkurl("feedback")">更多<i>+</i></a>
                </p>
            </div>
            <div class="side-book">
                <ul>
                    @{
                        DataTable backList = Html.get_plugin_method("DTcms.Web.Plugin.Feedback", "feedback", "get_feedback_list", 4, "is_lock=0 and site_id=" + Model.site.id);
                        foreach (DataRow dr in backList.Rows)
                        {
                            <li>
                                <span>@Html.datetostr(dr["add_time"], "yyyy-MM-dd")</span>
                                <a href="@Html.linkurl("feedback")">@dr["title"]</a>
                            </li>
                        }
                    }
                </ul>
            </div>
        </div>
    </div>
</div>
<!--留言链接-->
@section Scripts{
    <script type="text/javascript">
        layui.use(['carousel', 'myaspx'], function () {
            var carousel = layui.carousel, os = layui.myaspx;
            //建造实例
            carousel.render({
              elem: '#slide-box'
              , width: '100%' //设置容器宽度
              ,height:'100%'
              , arrow: 'always' //始终显示箭头
            });
            carousel.render({
              elem: '#focus-box'
              , width: '100%' //设置容器宽度
              ,height:'100%'
              , arrow: 'always' //始终显示箭头
            });
            $('#artAttach').get_attach_num('.b_attach', "@Model.config.webpath", 5,"view");
        });
    </script>
}